package com.elysia.adminservice.controller;

import com.elysia.adminservice.domain.dto.LoginDTO;
import com.elysia.adminservice.result.Result;
import com.elysia.adminservice.service.impl.IUserServiceImpl;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/login")
@RequiredArgsConstructor
@Slf4j
public class LoginController {
    private final IUserServiceImpl userService;
    @PostMapping
    public Result<Object> login(@RequestBody LoginDTO loginDTO, HttpServletResponse response) {
        log.info("登录请求: {}", loginDTO);
        return userService.login(loginDTO, response);
    }
}
